//
//  AppDelegate+QSPay.swift
//  TestSwift
//
//  Created by Song on 2018/7/5.
//  Copyright © 2018年 Song. All rights reserved.
//

import Foundation

extension AppDelegate {
    /// 回调
    /// func application(_ app: UIApplication, open url: URL, options: [UIApplicationOpenURLOptionsKey : Any] = [:]) -> Bool  在这个方法中调用
    func qs_applicationOpenUrl(_ url: URL) -> Bool {
        
        if url.host! == "safepay" {
            AlipaySDK.defaultService().processOrder(withPaymentResult: url) { (result) in
//                let resultDic = result as! Dictionary<String, Any>
            }
            
            return true
        } else {
            if QSPayTool.share.qs_weCharHandleOpenUrl(url) {
                return true
            }
        }
        
        return false
    }
}
